package com.huawei;

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String s = in.next();

		int len = 0;
		int temp;
		int max = 0;

		temp = s.length();
		String[] sl = new String[temp];

		for (int i = 0; i < temp; i++) {
			sl[i] = s.substring(i, i + 1);
			if (sl[i].compareTo("0") >= 0 & sl[i].compareTo("9") <= 0) {
				len++;
				if (max <= len) {
					max = len;
				}
			} else {
				len = 0;
			}
		}
		in.close();
		System.out.println(max);
	}
}
